package com.swufe.lianxi;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.GridView;
import android.widget.ListAdapter;

public class TestActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test);
        GridView testlist=findViewById(R.id.test);
        String data[]={"one","two","three"};
        ListAdapter adapter=new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,data);
        testlist.setAdapter(adapter);
        testlist.setEmptyView(findViewById(R.id.nodata));
    }
}